package com.ymatou.iapi.notify.testcase;

import com.ymatou.iapi.notify.parameter.SendNotifyBean;
import com.ymatou.iapi.notify.parameter.SendSpeedNotifyBean;
import com.ymatou.iapi.notify.parameter.SendSpeedNotifyByDeviceIdBean;
import com.ymatou.iapi.notify.service.SendSpeedNotifyByDeviceIdCall;
import com.ymatou.iapi.userregister.parameter.UserRegisterInfoRequestDtoBean;
import com.ymatou.iapi.userregister.service.UserRegisterInfoRequestDtoCall;
import com.ymttest.business.service.JUserCallService;
import com.ymttest.business.service.NotifyCallService;
import com.ymttest.business.service.YMTTrading.TradingCallService;
import com.ymttest.database.sqlwapper.ImDefaultWapper;
import com.ymttest.utils.TestDataManager;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;

import java.util.List;
import java.util.Map;

/**
*根据批量通知ID和设备列表发通知
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_SendSpeedNotifyByDeviceId{
	private static SendSpeedNotifyByDeviceIdBean sendspeednotifybydeviceidBean;
	private static SendSpeedNotifyByDeviceIdCall sendspeednotifybydeviceidCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("根据批量通知ID和设备列表发通知");
	}

	@Before
	public void caseUp() {
		sendspeednotifybydeviceidBean=new SendSpeedNotifyByDeviceIdBean();
		sendspeednotifybydeviceidCall=new SendSpeedNotifyByDeviceIdCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(sendspeednotifybydeviceidCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_SendSpeedNotifyByDeviceId_01() {
		Logger.start(true,"根据批量通知ID和设备列表发通知");
		try {
			//通过日志查看
			SendSpeedNotifyBean sendNotifyBean = NotifyCallService.initSendSpeedNotify(30156393);
			int notifyId = NotifyCallService.SendSpeedNotify(sendNotifyBean);
			String[] deviceIds = {TestDataManager.getRandomNum(5),TestDataManager.getRandomNum(5)};
			sendspeednotifybydeviceidBean.setDeviceIds(deviceIds);
			sendspeednotifybydeviceidBean.setNotifyId(notifyId);
			sendspeednotifybydeviceidCall.setData(sendspeednotifybydeviceidBean);
			sendspeednotifybydeviceidCall.callService();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

}